<template>
    <Table 
        ref="applyTable"
        :loading="loading" :columns="columns" :data="value" 
        :height="height"
        :highlight-row="highlight"
        :max-height="maxh"
        
        stripe 
        border >
        <template v-for="(col,index) in columns" v-if="col.slot" slot-scope="{row}"  :slot="col.slot">
            <slot :name="col.slot" :row="row"></slot>
        </template>
    </Table>
</template>
<script>
// import applySlot from './apply-slot.vue';
export default {
    name: 'applyTable',
    // components: { applySlot },
    provide: {
        applyTable: this,
    },
    props: {
        loading: {
            type: Boolean,
            default: false
        },
        isRowSelection: { //一个页面只能有一个表格 ref
            type: Boolean,
            default: false
        },
        highlight: { //单选
            type: Boolean,
            default: false
        },

        //flex固定高度
        isFixHeight: {
            type: Boolean,
            default: false
        },
        //可编辑单元格
        editIncell: {
            type: Boolean,
            default: false
        },
        
        columns: Array,
        value: Array,
        height: null,
        maxh: null,
        radios: {
            type: Object,
            default(){
                return {}
            }
        }
    },
    data () {
        return {
        }
    },
    created(){
        // console.log('refs1',this.$refs.appTable,this.$scopedSlots);
    },
    mounted () {
        // console.log('$scopedSlots', this.$scopedSlots)
        // console.log('$slots', this.$slots)
        // console.log('refs2',this.$refs.appTable.$scopedSlots);
        // this.$refs.appTable.$scopedSlots = this.$scopedSlots;
    }
}
</script>
